	<div class="container" ng-controller="ModalDemoCtrl">
		<div class="row">
			<div class="span3 bd-doc-sidebar">
				<div>
					<button class="btn btn-primary" ng-click="open()">Add Event</button>
					<form novalidate class="simple-form">
						<div modal="addModal" close="close()" options="opts">
							<div class="modal-header">
								<h4>New Event</h4>
							</div>
							<div class="modal-body">
								<div class="control-group">
									<label class="control-label span2" align="left">Title : </label>
									<div class="controls">
										<input ng-click="fillModal()" id="title" type="text" ng-model="new_event.title" required >
									</div>
								</div>
								<div class="control-group">
									<label class="control-label span2" align="left">Earliest Start Time : </label>

									<div id="datetimepicker_start_time" class="input-append">
										<input ng-click="fillModal()" ng-model="new_event.start_time" data-format="MM/dd/yyyy hh:mm" type="text" name="start_time"></input>
										<span class="add-on">
											<i data-time-icon="icon-time" data-date-icon="icon-calendar"></i>
										</span>
									</div>
								</div>
								<div class="control-group">
									<label class="control-label span2" align="left">Deadline : </label>
									<div id="datetimepicker_end_time" class="input-append">
										<input ng-click="fillModal()" ng-model="new_event.end_time" data-format="MM/dd/yyyy hh:mm" type="text" name="end_time"></input>
										<span class="add-on">
											<i data-time-icon="icon-time" data-date-icon="icon-calendar"></i>
										</span>
									</div>
								</div>
								<div class="control-group">
									<label class="control-label span2" align="left">Expect Cost Time : </label>
									<div class="controls">
										<input ng-click="fillModal()" id="time_cost" type="text" ng-model="new_event.time_cost" required >
									</div>
								</div>
								<div class="control-group">
									<label class="control-label span2" align="left">Location : </label>
									<div class="controls">
										<input ng-click="fillModal()" id="location" type="text" id="location" ng-model="new_event.location" required >
										<script type="text/javascript">
										function query() {
											var geocoder = new google.maps.Geocoder();
											alert($("#location").val());
											var address = $("#location").val();
											geocoder.geocode({
												'address' : address
											}, function(results, status) {
												if (status == google.maps.GeocoderStatus.OK) {
													alert(results.length)
													var i;
													for (i = 0; i < results.length; ) {
														geocoder.geocode({'latLng': results[i].geometry.location}, function(addresses, status) {
															if (status == google.maps.GeocoderStatus.OK) {
																alert(addresses[0].formatted_address);
															};
														})
														i = i + 1;
													}
												}});
										}
										$("#location").keyup(query);
										</script>
									</div>
								</div>
								<div class="well">
									<span>Is this event is sensitive to weather?</span>
									<rating value="sensitive_to_weather" max="5" ng-model="sensitive_to_weather"></rating>
								</div>
								<div class="well">
									<span>Is this event is important?</span>
									<rating value="importance" max="5" ng-model="importance"></rating>
								</div>
							</div>
							<div class="modal-footer">
								<button class="btn btn-primary" ng-click="addEvent(new_event)">Add</button>
								<button class="btn btn-warning cancel" ng-click="close()">Cancel</button>
							</div>
						</div>
						<div modal="updateModal" close="close()" options="opts">
							<div class="modal-header">
								<h4>Update Event</h4>
							</div>
							<div class="modal-body">
								<div class="control-group">
									<label class="control-label span2" align="left">Title : </label>
									<div class="controls">
										<input ng-click="fillModal()" id="title" type="text" ng-model="new_event.title" required >
									</div>
								</div>
								<div class="control-group">
									<label class="control-label span2" align="left">Earliest Start Time : </label>

									<div id="datetimepicker_start_time" class="input-append">
										<input ng-click="fillModal()" ng-model="new_event.start_time" data-format="MM/dd/yyyy HH:mm" type="text" name="start_time"></input>
										<span class="add-on">
											<i data-time-icon="icon-time" data-date-icon="icon-calendar"></i>
										</span>
									</div>
								</div>
								<div class="control-group">
									<label class="control-label span2" align="left">Deadline : </label>
									<div id="datetimepicker_end_time" class="input-append">
										<input ng-click="fillModal()" ng-model="new_event.end_time" data-format="MM/dd/yyyy HH:mm" type="text" name="end_time"></input>
										<span class="add-on">
											<i data-time-icon="icon-time" data-date-icon="icon-calendar"></i>
										</span>
									</div>
								</div>
								<div class="control-group">
									<label class="control-label span2" align="left">Expect Cost Time : </label>
									<div class="controls">
										<input ng-click="fillModal()" id="time_cost" type="text" ng-model="new_event.time_cost" required >
									</div>
								</div>
								<div class="control-group">
									<label class="control-label span2" align="left">Location : </label>
									<div class="controls">
										<input ng-click="fillModal()" id="location" type="text" id="location" ng-model="new_event.location" required >
									</div>
								</div>
								<div class="well">
									<span>Is this event is sensitive to weather?</span>
									<rating value="sensitive_to_weather" max="5" ng-model="sensitive_to_weather"></rating>
								</div>
								<div class="well">
									<span>Is this event is important?</span>
									<rating value="importance" max="5"></rating>
								</div>
							</div>
							<div class="modal-footer">
								<button class="btn btn-primary" ng-click="updateEvent(new_event)">Update</button>
								<button class="btn btn-warning cancel" ng-click="close()">Cancel</button>
							</div>
						</div>
					</form>
					<div>
						<ul class="unstyled">
							<li ng-repeat="event in eventList | orderBy:'start_time'">
								<div class="alert alert-info">
									<a class="close" ng-click="remove($index)"><i class="icon-remove"></i></a>
									<p ng-click="edit($index)"><b>{{event.title}}<b></p>
									<p ng-click="edit($index)">{{event.start_time}}</p>
								</div>
							</li>
						</ul>
					</div>
				</div>
			</div>
			<div class="span8">
				<!--<div class="alert-success calAlert"><h4>{{alertMessage}}</h4></div>-->
				<div class="btn-toolbar">
					<div class="btn-group">
						<button class="btn btn-success" ng-click="changeView('agendaDay')">AgendaDay</button>
						<button class="btn btn-success" ng-click="changeView('agendaWeek')">AgendaWeek</button>
						<button class="btn btn-success" ng-click="changeView('month')">Month</button>
					</div>
				</div>
				<div class="calendar" ng-model="eventSources" calendar="myCalendar" config="uiConfig.calendar" ui-calendar="uiConfig.calendar"></div>
			</div>
		</div>
	</div>